import os,sys,django
sys.path.insert(0,'./')
os.environ["DJANGO_SETTINGS_MODULE"]='meiduo_mall.settings.dev'
# os.environ["DJANGO_SETTINGS_MODULE"] = "meiduo_mall.settings.dev"
django.setup()
a=django.urls.resolve('/login/')
c=django.http.request.force_str(b'GET / HTTP/1.1\r\nHost: 127.0.0.1:8001\r\nConnection: keep-alive\r\nCache-Control: max-age=0\r\nUpgrade-Insecure-Requests: 1\r\nUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3\r\nAccept-Encoding: gzip, deflate, br\r\nAccept-Language: zh-CN,zh;q=0.9\r\n\r\n')
# d=django.http.request.HttpRequest().read()
from django.core.handlers.wsgi import WSGIRequest
d=WSGIRequest(c)

# c=django.core.handlers.wsgi.force_text()
print(d)
from goods.models import SKU
skus=SKU.objects.get(id=2)
print(skus.name)